package com.ibeeking.found.common.enums.receive;

/**
 * @ClassName FinConfigPayChannelEnum
 * @Description 各种固化收款渠道的常量定义
 * @Author ibeeking
 * @Date 2020-06-29 14:54
 **/
public enum FinConfigReceiveChannelEnum {
    /**
     * 收款渠道配置
     */
    RECEIVE_CHANNEL_WECHAT_APPLET("receive_channel_wechat_applet","微信小程序"),
    RECEIVE_CHANNEL_WECHAT_QRCODE("receive_channel_wechat_qrcode","微信付款码"),
    RECEIVE_CHANNEL_WECHAT_H5("receive_channel_wechat_h5","微信H5网页"),
    RECEIVE_CHANNEL_WECHAT_MP("receive_channel_wechat_mp","微信公众号"),
    RECEIVE_CHANNEL_ALIPAY_LIFE("receive_channel_alipay_life","支付宝生活号"),
    RECEIVE_CHANNEL_ALIPAY_APPLET("receive_channel_alipay_applet","支付宝小程序"),
    RECEIVE_CHANNEL_ALIPAY_QRCODE("receive_channel_alipay_qrcode","支付宝付款码"),
    RECEIVE_CHANNEL_ALIPAY_H5("receive_channel_alipay_h5","支付宝H5网页"),
    RECEIVE_CHANNEL_SWIFT("receive_channel_swift","威富通"),
    ;

    private String code;
    private String value;

    FinConfigReceiveChannelEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static String getNameByCode(String code) {
        for (FinConfigReceiveChannelEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj.getValue();
            }
        }
        return null;
    }
}
